
open(WRBUFF,">comm_genes.txt");
open(BUFF1,"1.txt");
open(BUFF2,"2.txt");
open(BUFF3,"3.txt");
open(BUFF4,"4.txt");
while($line = <BUFF1>)
{
	chomp $line;
	$line =~ s/\n//g;
	$line =~ s/\r//g;
	$hash1{$line} = 1;
	$hash5{$line} = "k";


}

while($line = <BUFF2>)
{
        chomp $line;
        $line =~ s/\n//g;
        $line =~ s/\r//g;
        $hash2{$line} = 1;
        $hash5{$line} = "k";


}
while($line = <BUFF3>)
{
        chomp $line;
        $line =~ s/\n//g;
        $line =~ s/\r//g;
        $hash3{$line} = 1;
        $hash5{$line} = "k";


}
while($line = <BUFF4>)
{
        chomp $line;
        $line =~ s/\n//g;
        $line =~ s/\r//g;
        $hash4{$line} = 1;
        $hash5{$line} = "k";


}
while (($key, $value) = each(%hash5)){
     #print $key.", ".$value."<br />";
	if($hash1{$key} == 1 && $hash2{$key} == 1 && $hash3{$key} == 1 && $hash4{$key} == 1 ) 
	{ print WRBUFF $key."\n";}
}

